package com.bamboo.cmsservice.controller;


import com.bamboo.cmsservice.entity.CrmBanner;
import com.bamboo.cmsservice.service.CrmBannerService;
import com.bamboo.commonutils.ResponseEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author jack.wu
 * @since 2020-07-12
 */
@Api(description = "轮播图前台")
@RestController
@RequestMapping("/cmsservice/banner/front")
@CrossOrigin
public class BannerFrontController {

    @Resource
    private CrmBannerService bannerService;

    @ApiOperation(value = "首页查询所有banner")
    @GetMapping("list")
    public ResponseEntity getAllBanner() {
        List<CrmBanner> bannerList = bannerService.selectAllBanner();
        return ResponseEntity.ok().data("list", bannerList);
    }

}

